/*
 Copyright (C) 2004-2006 the Minisip Team
 
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.
 
 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.
 
 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */

/* Copyright (C) 2004 
 *
 * Authors: Erik Eliasson <eliasson@it.kth.se>
 *          Johan Bilien <jobi@via.ecp.fr>
*/

#ifndef LOG_ENTRY_H
#define LOG_ENTRY_H

#include<libminisip/libminisip_config.h>

#include<string>

#include<libmutil/MemObject.h>

class LogEntryHandler;

class LIBMINISIP_API LogEntry : public MObject{
	public:

		virtual std::string getMemObjectType() const {return "LogEntry";}
		
		int type;
		 std::string peerSipUri;
		time_t start;
		static MRef<LogEntryHandler *> handler;
		void handle();
};

class LIBMINISIP_API LogEntrySuccess : public LogEntry {
	public:
		time_t duration;
		bool secured;
		int mos;
};

class LIBMINISIP_API LogEntryFailure : public LogEntry {
	public:
		 std::string error;

};

class LIBMINISIP_API LogEntryIncoming{};
class LIBMINISIP_API LogEntryOutgoing{};

class LIBMINISIP_API LogEntryMissedCall:public LogEntryFailure, public LogEntryIncoming{

};

class LIBMINISIP_API LogEntryCallRejected:public LogEntryFailure, public LogEntryOutgoing{

};

class LIBMINISIP_API LogEntryIncomingCompletedCall : public LogEntryIncoming, public LogEntrySuccess{

};

class LIBMINISIP_API LogEntryOutgoingCompletedCall : public LogEntryOutgoing, public LogEntrySuccess{
};

class LIBMINISIP_API LogEntryHandler : public virtual MObject{
	public:
		virtual void handle( MRef<LogEntry *> )=0;

		virtual std::string getMemObjectType() const { return "LogEntryHandler";};
};


#endif
